import json

from django.http import HttpResponse
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from django.views.generic import View


class Image(View):
    def get(self, request, *args, **kwargs):
        test = 'failed'
        if( 'test' in request.POST ) :
            test = request.POST.get("test","default")
        commonHelp = Common()
        return HttpResponse(test)
        #return commonHelp.json_out([123])

class Common:
    def json_out(self,data):
        #json_data = serializers.serialize("json", data)
        json_data = json.dumps(data)
        return HttpResponse(json_data,content_type="application/json")